#include <iostream>
#include <vector>

using namespace std;

class Solution{
public:
    void process(const std::vector<int>& vec){
        if(vec.empty()) return;
        std::vector<int> res;
        dfs(vec,res,0);
    }
    void dfs(const std::vector<int>& vec,std::vector<int>& res,int index){
        if(5==index){
            for(auto item:res){
                std::cout << item << ","; 
            }
            std::cout <<std::endl; 
            return;
        }
        for(int i=0;i<vec.size();++i){
            res.push_back(vec[i]);
            dfs(vec,res,index+1);
            res.pop_back();
        }

    }
};

int main() {
    const std::vector<int> vec{1,2,3};
    Solution().process(vec);
    return 0;
}